package topevery.syn.data.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import topevery.syn.data.model.codec.ModelTypeEnumCodec;

import java.time.LocalDateTime;

/**
 * 模型数据
 */
@Data
public class ObjectModelData implements IGlbModel {

    @JSONField(name = "a")
    public Long gid;

    @JSONField(name = "b", serializeUsing = ModelTypeEnumCodec.class, deserializeUsing = ModelTypeEnumCodec.class)
    public ModelTypeEnum modelType = ModelTypeEnum.ObjectModel;

    @JSONField(name = "c")
    public  String deviceCode;
    @JSONField(name = "d")
    public String modelJson;
    @JSONField(name = "e")
    public LocalDateTime dbCreateDate;
//    @JSONField(name = "f")
//    public LocalDateTime gpsDate;
//    @JSONField(name = "g")
//    public double lngSrc;
//    @JSONField(name = "h")
//    public double latSrc;
//    @JSONField(name = "k")
//    public double absY;
//    @JSONField(name = "l")
//    public double absX;
//    @JSONField(name = "m")
//    public double lng;
//    @JSONField(name = "n")
//    public double lat;
//    @JSONField(name = "o")
//    public double speed;
//    @JSONField(name = "p")
//    public int degree;
//    @JSONField(name = "q")
//    public int starNumber;
//    @JSONField(name = "r")
//    public int state;
//    @JSONField(name = "s")
//    public int alarmFlag;
//    @JSONField(name = "t")
//    public byte upType;
//    @JSONField(name = "u")
//    public int mileageNum;
//    @JSONField(name = "v")
//    public int altitude;
//    @JSONField(name = "w")
//    public LocalDateTime stateDate;
//    @JSONField(name = "x")
//    public boolean accState;
//    @JSONField(name = "y")
//    public boolean chargeState;
//    @JSONField(name = "z")
//    public short gsmSignalIntensity;
//    @JSONField(name = "a1")
//    public short voltageLevel;
//    @JSONField(name = "a2")
//    public short warningExtInfo;
//    @JSONField(name = "a3")
//    public boolean warningExtInfoChild0;
//    @JSONField(name = "a4")
//    public int stepCountCurr;

    @JSONField(name = "a5")
    public  String clientKey;

    @Override
    public String getGlbModelKey() {
        return deviceCode;
    }

    @Override
    public Long getGid() {
        return gid;
    }

    @Override
    public void setGid(Long gid) {
        this.gid = gid;
    }

    @Override
    public ModelTypeEnum getModelType() {
        return modelType;
    }

    @Override
    public void setModelType(ModelTypeEnum modelType) {
        this.modelType = modelType;
    }
}
